<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:id="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../css/backstage.css" type="text/css"/>
    <title>JpetStore后台管理</title>
    <script th:src = "@{/JS/jquery-3.2.1.js}"></script>
    <script th:src = "@{/JS/jquery-ui.js}"></script>
</head>
<body>
<div th:replace="/administrator/common/head.html"></div>
<div class="mid">
    <div class="title">
        <label >新增产品</label><br>
    </div>
    <form action="/catalog/saveProduct" method="post" class="addItem" id="newProductPage" enctype="multipart/form-data">
        <div>
            <label>请选择宠物种类：
                <select id="category" name="categoryId">
                    <option value="BIRDS">Birds</option>
                    <option value="CATS">Cats</option>
                    <option value="DOGS">Dogs</option>
                    <option value="FISH">Fish</option>
                    <option value="REPTILES">Reptiles</option>
                </select>

                <!--刚开始让其显示空-->
                <script>
                    var category = document.getElementById("category");
                    category.value = "";
                </script>
            </label>
        </div>
        <div>
            随机生成的产品ID:<input type="text" id="productId" name="productId" style="width: 100px" readonly="readonly">
            <br>
            <p>
                请输入产品名:<input type="text" name="name" id="productName" style="width:200px" required="required">
            </p>
        </div>

        <div>
            <label for="fileupload" class="updata_file"><u>点击这里上传图片</u></label>
            <input type="file" id="fileupload" style="display: none" name="upload">
            <br/>
            <img src="" id="imageview" style="display: none;width: 200px;height: 200px">
        </div>
        <div>
            输入你对产品的描述:<input type="text" name="description" id="description" style="width:200px" required="required">
        </div>
        <div>
            <input type="submit" th:value="提交" width="100px">
        </div>
        <script th:src="@{/JS/administrator/catalog/AddProduct.js}"></script>
    </form>
</div>
<div th:replace="/administrator/common/foot.html"></div>
</body>
</html>